//
//  BIZLiveHistoryAnswerCell.m
//  biz
//
//  Created by LXL on 2017/6/20.
//  Copyright © 2017年 jieshuibao. All rights reserved.
//

#import "BIZLiveHistoryAnswerCell.h"
#import "BIZLiveHistoryAnswerModel.h"

@interface BIZLiveHistoryAnswerCell()
@property (weak, nonatomic) IBOutlet UILabel *dateLabel;
@property (weak, nonatomic) IBOutlet UILabel *timeLabel;
@property (weak, nonatomic) IBOutlet UILabel *questionLabel;
@property (weak, nonatomic) IBOutlet UILabel *answerLabel;
@property (weak, nonatomic) IBOutlet UILabel *answerMarkLabel;
@property (weak, nonatomic) IBOutlet UIImageView *answerImageView;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *answerTopLayout;

@end

@implementation BIZLiveHistoryAnswerCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    

}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

-(void)setLiveHistoryAnswerModel:(BIZLiveHistoryAnswerModel *)liveHistoryAnswerModel {
    _liveHistoryAnswerModel = liveHistoryAnswerModel;
    
    NSString *dateStr = [NSDate stringFromTimestamp:liveHistoryAnswerModel.qtime];
    self.dateLabel.text = [dateStr substringToIndex: 10];
    self.timeLabel.text = [dateStr substringFromIndex:10];
    self.questionLabel.text = liveHistoryAnswerModel.question;
    
    if (liveHistoryAnswerModel.answer && liveHistoryAnswerModel.answer.length) {
        self.answerLabel.text = liveHistoryAnswerModel.answer;
        
    } else {
        self.answerTopLayout.constant = 0;
        self.answerImageView.image = [UIImage imageNamed:@""];
        self.answerMarkLabel.text = @"";
        self.answerLabel.text = @"";
    }
    
    
}

@end
